package cn.fenghua.demoproject2.controller;

import cn.fenghua.demoproject2.dao.Video;
import cn.fenghua.demoproject2.service.VideoService;
import cn.fenghua.demoproject2.utils.JsonData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/v1/video")
public class VideoController {

    @Autowired
    VideoService videoService;

    // @RequestMapping(value = "list", method = RequestMethod.GET)
    @GetMapping("list")
    public Object list() {
        List<Video> list = videoService.listVideo();

        return JsonData.buildSuccess(list);
    }
}
